package com.haoxi.gateway.cmpp30msg;

/**
 * Title:CMPP3.0,2004.09
 */

import java.io.IOException;
import java.io.OutputStream;


/**
 * ʵ��CMPP3.0��CMPP_TERMINATE
 */
public class CMPPTerminate {
    private byte[] outbytes;

    /**
     * ����һ��CMPP_TERMINATE
     *
     * @param SequenceID ��Ϣ���
     */
    public CMPPTerminate ( int SequenceID ) {
        CMPPMsgHead head = new CMPPMsgHead ( CMPPCommon.MSG_HEAD_LENGTH, CMPPCommon.CMPP_TERMINATE, SequenceID );
        outbytes = head.getMsgHead ();
    }

    /**
     * ���ֽ�������ʽ��CMPP_TERMINATE�����
     *
     * @param out �����
     * @throws IOException ��IOΥ��ʱ
     */
    public void write ( OutputStream out ) throws IOException {
        out.write ( outbytes );
        out.flush ();
    }

    /**
     * ���ֽ��������ʽ����CMPP_TERMINATE��
     *
     * @return �ֽ�������ʽ��CMPP_TERMINATE
     */
    public byte[] getBytes () {
        return outbytes;
    }
}